<template>
	<van-tabs v-model:active="active">
		<van-tab title="工作流进度" name="steps">
			<van-steps direction="vertical" :active="wkfActivityList.length-1">
				<van-step v-for="(item,index) in wkfActivityList" :key="index">
					<h3>{{item.name}}</h3>
					<p>{{item.update_by}}</p>
					<p>{{item.start_date}}</p>
					<p>{{item.end_date}}</p>
				</van-step>
			</van-steps>
		</van-tab>
		<van-tab title="工作流意见" name="opinion">
			<van-steps direction="vertical" :active="wkfCommentList.length-1">
				<van-step v-for="(item,index) in wkfCommentList" :key="index">
					<h3>{{item.create_by}}</h3>
					<p>{{item.create_date}}</p>
					<p>{{item.comment}}</p>
				</van-step>
			</van-steps>
		</van-tab>
	</van-tabs>
</template>

<script>
	import utils from '@/utils/utils.js';
	export default {
		name: "WorkflowStepsComponent",
		props: ["componentModel"],
		inject:['children'],
		mounted() {
			this.children.push(this);
		},beforeUnmount() {
			utils.removeArrayElement(this.children,this);
		},data() {
			return {
				active:"steps",
				wkfActivityList: [],
				wkfCommentList:[],
			}
		},methods: {
			setProp(prop) {
				if(prop["wkfActivityList"]!=undefined){
					if(prop["wkfActivityList"]==null){
						this.wkfActivityList = [];
						this.wkfCommentList =[];
					}else{
						this.wkfActivityList = prop["wkfActivityList"];
						this.wkfCommentList = prop["wkfCommentList"];
					}
				}
				
			},
		},
	}	
</script>

<style>
</style>
